// 变量的组合类型
let hd: string | number;
hd = "houdunren.com";
hd = 2024;
console.log(hd);

// 数组的组合类型，元素为string或者number
const array: (string | number)[] = ["chengzhu", "zhangyun"];
array.push(2024);
console.log(array);

// 使用泛型来设置数组的组合类型
const arr: Array<string | number> = ["chengzhu", "zhangyun"];
arr.push(2025);
console.log(arr);
